import QtQuick 2.2
import QtQuick.Layouts 1.1

/**
  * repeater
  */

Rectangle {
    width: 400;
    height: 200;
    color: "#EEEEEE";

    RowLayout {
        anchors.fill: parent;
        spacing: 4;

        Repeater {
            // model: 8; // any
//            model: ["Qt", "Quick"]; // string list
            model: [
                {"name":"Zhang San", "mobile":"13888888888"},
                {"name":"Wind", "mobile":"13777777777"},
                {"name":"Huck", "mobile":"13999999999"}
            ]
            Rectangle {
                width: 46;
                height: 30;
                color: "steelblue";
                Text {
                    anchors.fill: parent;
                    color: "black";
                    font.pixelSize: 14;
                    verticalAlignment: Text.AlignVCenter;
                    horizontalAlignment: Text.AlignHCenter;
//                    text: index; //序号
//                    text: modelData;
                    text: modelData.name+modelData.mobile; // object
                }
            }
        }
    }
}

